<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>海科任务督办管理系统</title>
<link rel="alternate icon" type="image/png"
	href="<%=path%>/resourse/AmazeUI-2.7.2assets/i/favicon.png">
<link rel="stylesheet"
	href="<%=path%>/resourse/AmazeUI-2.7.2/assets/css/amazeui.min.css" />
<link rel="stylesheet"
	href="<%=path%>/resourse/AmazeUI-2.7.2/assets/css/admin.css">
<style>
body {
	background: linear-gradient(to right, rgba(255, 0, 0, 0),
		rgba(229, 241, 243, 1));
}

.header {
	text-align: center;
}

.header h1 {
	font-size: 200%;
	color: #333;
	margin-top: 30px;
}

.header p {
	font-size: 14px;
}
</style>
</head>
<body>
	<div class="header">
		<div class="am-g">
			<h1>海科任务督办管理系统</h1>
			<!-- 			<p> -->
			<!-- 				Integrated Development Environment<br />代码编辑，代码生成，界面设计，调试，编译 -->
			<!-- 			</p> -->
		</div>
		<hr />
	</div>
	<div class="am-g">
		<div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
			<!-- 			<h3>登录</h3> -->
			<!-- 			<hr> -->
			<!-- 			<div class="am-btn-group"> -->
			<!-- 				<a href="#" class="am-btn am-btn-secondary am-btn-sm"><i -->
			<!-- 					class="am-icon-github am-icon-sm"></i> Github</a> <a href="#" -->
			<!-- 					class="am-btn am-btn-success am-btn-sm"><i -->
			<!-- 					class="am-icon-google-plus-square am-icon-sm"></i> Google+</a> <a -->
			<!-- 					href="#" class="am-btn am-btn-primary am-btn-sm"><i -->
			<!-- 					class="am-icon-stack-overflow am-icon-sm"></i> stackOverflow</a> -->
			<!-- 			</div> -->
			<br> <br>

			<form method="post" class="am-form">
				<label for="email">登录名:</label> <input type="email" name="loginname"
					id="loginname" value=""> <br> <label for="password">密码:</label>
				<input type="password" name="password" id="password" value="">
				<!-- 				<br> <label for="remember-me"> <input id="remember-me" -->
				<!-- 					type="checkbox"> 记住密码 -->
				<!-- 				</label> <br /> -->
				<br />
				<div class="am-cf">
					<input type="button" value="登录" onclick="login()"
						class="am-btn am-btn-default am-btn-sm am-fr">
					<!-- 						 <input -->
					<!-- 						type="submit" name="" value="登 录" -->
					<!-- 						class="am-btn am-btn-primary am-btn-sm am-fl"> -->
					<!--         <input type="submit" name="" value="忘记密码 ^_^? " class="am-btn am-btn-default am-btn-sm am-fr"> -->
				</div>
			</form>
			<hr>
			<!-- 			<p>山东海科化工集团有限公司.</p> -->
		</div>
	</div>

	<script>
		function login() {
			var name = $('#loginname').val();
			var pwd = $('#password').val();
			console.log('name:' + name + 'pwd:' + pwd);
			$.ajax({
				type : "post",
				url : "sys/loginin",
				//                dataType: "xml",
				data : {
					loginname : name,
					pwd : pwd
				},
				success : function(data) {
					if (data == 1) {
						window.location.href = "task/statis";
					} else {
						alert('用户名或密码不正确');
					}
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					alert(errorThrown);
				}
			});
		}
	</script>

	<script src="<%=path%>/resourse/js/jquery.min.js"></script>
</body>
</html>